<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:44:"themes/admin_simpleboot3/admin/user/add.html";i:1597904481;s:43:"themes/admin_simpleboot3/public/header.html";i:1584585426;}*/ ?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->
    <title><?php echo Config('web_name'); ?></title>

    <link href="__TMPL__/public/assets/themes/<?php echo cmf_get_admin_style(); ?>/bootstrap.min.css" rel="stylesheet">
    <link href="__TMPL__/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
    <link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <style>
        form .input-order {
            margin-bottom: 0px;
            padding: 0 2px;
            width: 42px;
            font-size: 12px;
        }

        form .input-order:focus {
            outline: none;
        }

        .table-actions {
            margin-top: 5px;
            margin-bottom: 5px;
            padding: 0px;
        }

        .table-list {
            margin-bottom: 0px;
        }

        .form-required {
            color: red;
        }
    </style>
    <script type="text/javascript">
        //全局变量
        var GV = {
            ROOT: "__ROOT__/",
            WEB_ROOT: "__WEB_ROOT__/",
            JS_ROOT: "static/js/",
            APP: '<?php echo \think\Request::instance()->module(); ?>'/*当前应用名*/
        };
    </script>
    <script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/js/wind.js"></script>
    <script src="__TMPL__/public/assets/js/bootstrap.min.js"></script>
    <script src="__TMPL__/public/assets/js/echarts.js"></script>
    <script>
        Wind.css('artDialog');
        Wind.css('layer');
        $(function () {
            $("[data-toggle='tooltip']").tooltip();
            $("li.dropdown").hover(function () {
                $(this).addClass("open");
            }, function () {
                $(this).removeClass("open");
            });
        });
    </script>
    <?php if(APP_DEBUG): ?>
        <style>
            #think_page_trace_open {
                z-index: 9999;
            }
        </style>
    <?php endif; ?>
    <link rel="stylesheet" href="__STATIC__/js/element/css/element.css">
    <style>
        [v-cloak] {
            display: none !important;
        }
        table th, table td{text-align: center;}
        .avatar-uploader .el-upload {
            border: 1px dashed #d9d9d9;
            border-radius: 6px;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }
        .avatar-uploader .el-upload:hover {
            border-color: #409EFF;
        }
        .avatar-uploader-icon {
            font-size: 28px;
            color: #8c939d;
            width: 178px;
            height: 178px;
            line-height: 178px;
            text-align: center;
        }
        .avatar {
            width: 178px;
            height: 178px;
            display: block;
        }
        input[type="file"] {
            display: none !important;
        }
        .border_class{
            border: none;
        }
        th{
            background-color: rgb(249,249,249);
        }
    </style>
</head>
<body>
<script type="text/html" id="photos-item-tpl">
    <li id="saved-image{id}">
        <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">
        <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"
               style="width: 200px;" title="图片名称">
        <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
             onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
    </li>
</script>

<div class="wrap js-check-wrap" id="app" v-cloak>
    <ul class="nav nav-tabs">
        <li><a href="<?php echo url('user/index'); ?>">员工管理</a></li>
        <li class="active"><a href="<?php echo url('user/add'); ?>">员工添加</a></li>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="<?php echo url('user/addpost'); ?>">

        <div class="row">
            <div class="col-md-9">
                <table class="table table-bordered">
                    <tr>
                        <th style="width: 170px">工号</th>
                        <td>
                            <input type="text" class="form-control border_class" name="post[employee_id]" autocomplete="off">
                        </td>
                        <th style="width: 170px">姓名</th>
                        <td>
                            <input type="text" class="form-control border_class" id="input-user_login" name="post[user_login]"
                                   required="required" autocomplete="off" >
                        </td>
                    </tr>
                    <tr>
                        <th style="width: 170px">手机号码</th>
                        <td>
                            <input type="text" class="form-control border_class" name="post[mobile]" autocomplete="off">
                        </td>
                        <th>角色</th>
                        <td>
                            <select class="form-control border_class" name="role_id"><?php echo $roleList; ?></select>
                            <input type="hidden" name="company_id" value="<?php echo $company['id']; ?>">
                        </td>
                    </tr>
                    <tr>
                        <th style="width: 170px"><?php echo lang('PASSWORD'); ?></th>
                        <td>
                            <input type="password" class="form-control border_class" id="input-user_pass" name="post[user_pass]" autocomplete="new-password">
                        </td>
                        <th style="width: 170px">重复密码</th>
                        <td>
                            <input type="password" class="form-control border_class" id="input-user_pass_aging" name="post[d_pass]" autocomplete="new-password">
                        </td>
                    </tr>

                    <tr>
                        <th>性别</th>
                        <td>
                            <select class="form-control border_class" name='post[sex]'>
                                <option value="0">保密</option>
                                <option value="1">男</option>
                                <option value="2">女</option>
                            </select>
                        </td>
                        <th>生日</th>
                        <td>
                            <input type="date" class="form-control border_class" name="post[birthday]" autocomplete="off">
                        </td>
                    </tr>
                    <tr>
                        <th>城市</th>
                        <td>
                            <input type="text" class="form-control border_class" name="post[city]" autocomplete="off">
                        </td>
                    </tr>
                </table>
                <!--角色弹窗-->
                <div id="roleselect_tc" style="display: none;">
                    <div id="roleselect_list" style="margin: 5px;"></div>
                </div>

                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary js-ajax-submit"><?php echo lang('ADD'); ?></button>
                    </div>
                </div>

            </div>

            <div class="col-md-3">
                <table class="table table-bordered">
                    <tr>
                        <th><b>头像上传</b></th>
                    </tr>
                    <tr>
                        <td>
                            <div style="text-align: center;">
                                <input type="hidden" name="post[avatar]" id="thumbnail" value="">
                                <a href="javascript:uploadOneImage('图片上传','#thumbnail');">
                                    <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                                         id="thumbnail-preview"
                                         width="130" height="130" style="cursor: pointer;border-radius: 50%"/>
                                </a>
                                <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<!--<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>-->
<!--<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>-->
<!--<script type="text/javascript" src="__STATIC__/js/layer/layer.js"></script>-->
<!--<script src="__STATIC__/js/zy-treeview/zy-treeview.1.0.js"></script>-->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="__STATIC__/js/element/js/element.js"></script>


<script type="text/javascript">

    let app = new Vue({
        el: '#app',
        data:{

        },
        created: function () {
            let that = this;
            // $.ajax({
            //     url: "<?php echo cmf_plugin_url('Member://product/categoryAll'); ?>",
            //     data: {
            //     },
            //     dataType: "json",
            //     type: "post",
            //     success: function(res) {
            //         console.log(res);
            //         if(res.code === 200){
            //             that.options = res.data.arr.options;
            //             that.loan_options = res.data.loan_arr.options;
            //         }
            //     }
            // });
        },
        methods: {
            // changeRecommend(id) {
            //     let recom = document.getElementById('rcom_' + id);
            //     let that = this;
            //     $.ajax({
            //         url: "<?php echo cmf_plugin_url('Member://product/changeRecommend'); ?>",
            //         data: {
            //             id: id,
            //             check_status: recom.checked
            //         },
            //         dataType: "json",
            //         type: "post",
            //         success: function (res) {
            //             if (res.code === 200) {
            //                 that.$message({
            //                     type: 'success',
            //                     message: res.message
            //                 });
            //             } else {
            //                 that.$message({
            //                     type: 'error',
            //                     message: res.message
            //                 });
            //                 recom.checked = !recom.checked;//取消勾选
            //             }
            //
            //         }
            //     });
            // }
        }

    })

//     $(function () {
//         var SELECT_ID = null, SELECT_NAME = null;
//         var list = <?php echo $roleList; ?>;
//         var highest = null;
//         //选择角色弹窗·
//         //获取角色id
//         var role_id = $('input[id=role_id]').val();
//         $('#role_select').on('click', function () {
//             $("#roleselect_list").treeView({data: list, radio: true});
//             //加载角色数据
//             //弹出选择框
//             var index = layer.open({
//                 type: 1,
//                 title: '修改角色',
//                 area: ['700px', '600px'],
//                 closeBtn: 1,
//                 btn: ['确定', '取消'],
//                 shadeClose: true,
//                 skin: 'yourclass',
//                 scrollbar: false,
//                 content: $("#roleselect_tc "),
//                 yes: function () {
//                     //获取选中数据
//                     $('input[id=role_id]').val(SELECT_ID);
//                     $('input[name=role_name]').val(SELECT_NAME);
//                     layer.close(index);
//                 }
//             });
//         });
//
// //列表点击事件
//         $("#roleselect_list").on('click', 'li', function () {
//             $(this).css('backgroundColor', '#ccc');
//             var name = $(this).find('.li_text').text();
//             var id = $(this).data('tag');
//             console.log(id);
//             $(this).find('.tree_radio').prop('checked', true);
//             SELECT_ID = id;
//             SELECT_NAME = name;
//             /*        $('input[id=role_id]').val(id);
//                     $('input[name=role_name]').val(name);*/
//         });
//     });
</script>


</body>
</html>